public class text {

}
class Solution {
    public int maximizeSum(int[] nums, int k) {
        int max = nums[0];
        for(int x : nums)
            max = Math.max(x,max);
        return max*k + (k-1)*k/2;
    }
}